/**
 * Copyright (C)  2011-2011  Jesse Meng (pingf0@gmail.com).
 *
 * This file is part of OOC-GCC.
 *
 * OOC-GCC is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * OOC-GCC is distributed in the hope that it will be useful,but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with OOC-GCC. If not, see
 * <http://www.gnu.org/licenses/>.
 */

#include "OOStd.h"

CLASS_RAW(A){
	int a;
};
ASM_C0(A,NULL,NULL)

CLASS_RAW(B){
	CLASS_RAW_EX(A);
	int b;
};
ASM_C1(B,A,NULL,NULL)


STATIC_RAW(SA){
	int a;
};
ASM_S0(SA,NULL,NULL)

STATIC_RAW(SB){
	STATIC_RAW_EX(SA);
	int b;
};
ASM_S1(SB,SA,NULL,NULL)

CLASS_ROOT_EX(C,B){
	int c;
	STATIC_ROOT_EX(C,SB);
	int c;
};
ASM_XY(C,B,SB,NULL,NULL,NULL,NULL)

CLASS_EX(D,C){
	int d;
	STATIC_EX(D,C);
	int d;
};
ASM_11(D,C,NULL,NULL,NULL,NULL)

CLASS_EX(E,D){
	int e;
	STATIC_EX(E,D);
	int e;
};
ASM_11(E,D,NULL,NULL,NULL,NULL)

int main(){

	C *c=NULL;
	D *d=NULL;
	E *e=NULL;
	printf("*************NEW E\n");
	e=NEW0(E);
	printf("*************NEW D\n");
	d=NEW0(D);
	printf("*************NEW C\n");
	c=NEW0(C);
	printf("*************DEL D\n");
	DELETE0(d);
	printf("*************DEL E\n");
	DELETE0(e);
	printf("*************DEL C\n");
	DELETE0(c);

	return 0;
}
